.TH std::atomic_ref::operator++,++(int),--,--(int) 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::atomic_ref::operator++,++(int),--,--(int) \- std::atomic_ref::operator++,++(int),--,--(int)

.SH Synopsis
   member of atomic_ref<Integral> specializations
   and atomic_ref<T*> partial specialization
   value_type operator++() const noexcept;        \fB(1)\fP \fI(since C++20)\fP
   value_type operator++( int ) const noexcept;   \fB(2)\fP \fI(since C++20)\fP
   value_type operator--() const noexcept;        \fB(3)\fP \fI(since C++20)\fP
   value_type operator--( int ) const noexcept;   \fB(4)\fP \fI(since C++20)\fP

   Atomically increments or decrements the current value of the referenced object.
   These operations are read-modify-write operations.

   1) Performs atomic pre-increment. Equivalent to return fetch_add\fB(1)\fP + 1;.
   2) Performs atomic post-increment. Equivalent to return fetch_add\fB(1)\fP;.
   3) Performs atomic pre-decrement. Equivalent to return fetch_sub\fB(1)\fP - 1;
   4) Performs atomic post-decrement. Equivalent to return fetch_sub\fB(1)\fP;.

   For signed Integral types, arithmetic is defined to use two’s complement
   representation. There are no undefined results.

   For T* types, the result may be an undefined address, but the operations otherwise
   have no undefined behavior. The program is ill-formed if T is not an object type.

.SH Return value

   1,3) The value of the referenced object after the modification.
   2,4) The value of the referenced object before the modification.

.SH Notes

   Unlike most pre-increment and pre-decrement operators, the pre-increment and
   pre-decrement operators for atomic_ref do not return a reference to the modified
   object. They return a copy of the stored value instead.

.SH See also

              atomically adds the argument to the value stored in the referenced object
   fetch_add  and obtains the value held previously
              \fI(public member function)\fP
              atomically subtracts the argument from the value stored in the referenced
   fetch_sub  object and obtains the value held previously
              \fI(public member function)\fP
   operator+= atomically adds to or subtracts from the referenced value
   operator-= \fI(public member function)\fP
   operator&= atomically performs bitwise AND, OR, XOR with the referenced value
   operator|= \fI(public member function)\fP
   operator^=
